/** @file hdf5_dataset.h
 *
 *  @author Dongryeol Lee (drselee@gmail.com)
 */

#ifndef CORE_DATA_HDF5_DATASET_H
#define CORE_DATA_HDF5_DATASET_H

#include <armadillo>
#include <vector>

#include "core/data/dataset.h"

namespace core {
namespace data {

class Hdf5Dataset  : public core::data::Dataset {

  private:

    arma::mat matrix_;

    std::vector<int> count_;

    std::vector<int> offset_;

  public:

    Hdf5Dataset();

    ~Hdf5Dataset();

    double average_num_points() const;

    arma::vec &get_instance(int point_id);

    const arma::vec &get_instance(int point_id) const;

    core::data::alias_vec &get_instance(
      int point_id, core::data::alias_vec **targets_out);

    const core::data::alias_vec &get_instance(
      int point_id, const core::data::alias_vec **targets_out) const;

    void Init(int num_attributes, int num_points);

    bool Init(const std::string &file_name_in);

    void Init(
      boost::mpi::communicator &world,
      const std::string &file_name_in, bool from_single_file) ;

    int num_points() const;

    void RandomGenerate(
      boost::mpi::communicator &world, int num_dimensions, int num_points) ;
};
}
}

#endif
